<?php 
//include('../Connections/KRAPPERCON.php');
$sql = 'call sp_selProv(0);';
$res = $mysqli->query($sql)or die($mysqli->error.__LINE__);
if ($res){
	if (isset($_POST['t_codprv'])) {
		$codprv = $_POST['t_codprv'];
		while($row = $res->fetch_assoc()){
			$sel = '';
			if ($row['ProveedID']==$codprv) $sel = 'selected="selected"';
			echo "<option ".$sel." value='".$row['ProveedID']."'>".$row['ProveedNom']."</option>";	
		}		
	}
	else {
		while($row = $res->fetch_assoc()){
			echo "<option value='".$row['ProveedID']."'>".$row['ProveedID']." - ".$row['ProveedNom']."</option>";	
		}
	}
	$res->close();
	$mysqli->check_result();
}
else {

}
//mysql_free_result($res2);

?>	